      PROGRAM MACHINE_ID
      integer*4 laddr/z'FFFF000E'/
      integer*2 ibyte
c
c     This program is a demonstration of an all-Fortran PEEK routine.
c     It will return the machine ID byte from address FFFF:000E;
c     this location tells you whether your machine is a PC, an XT,
c     or an AT.
c
      call peekb(laddr,ibyte)
      print 20, ibyte
   20 format (' ibyte = ',z2)
c
      stop
      end
      SUBROUTINE PEEKB(LADDR,IBYTE)
      integer*4 laddr                   ! Address of byte to get
      integer*2 ibyte                   ! Value of that location
      call peekb0(carg(laddr),ibyte)    ! CARG function passes by value
      ibyte=iand(ibyte,255)             ! Trim off extra byte
      return
      end
      SUBROUTINE PEEKB0(I,IBYTE)
      integer*2 i,ibyte
      ibyte=i                           ! Get what's there
      return
      end
